﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GenericLibrariesToolKit;
using Model;

namespace BLL.Info.Impl
{
    /// <summary>
    /// 出版物业务接口实现
    /// </summary>
    public class PublicationBOImpl : DaoSupport<Publication>, PublicationBO
    {
        public List<Publication> ShowTopPublication(int topNumber)
        {
            Dictionary<string, string> orderByDictionary = new Dictionary<string, string>();
            //添加排序条件及排序方式
            orderByDictionary.Add("PublicationClickAmount", "desc");
            //执行查询
            QueryResult<Publication> publicationQueryResult = GetScrollData(0, topNumber, orderByDictionary);
            //获取数据列表
            List<Publication> publications = publicationQueryResult.ResultList;
            return publications;
        }

        public List<Publication> ShowLatestTopPublication(int topNumber)
        {
            Dictionary<string, string> orderByDate = new Dictionary<string, string>();
            //添加排序条件及排序方式
            orderByDate.Add("PublicationDate", "desc");
            //执行查询
            QueryResult<Publication> PublicationQueryResult = this.GetScrollData(0, topNumber, orderByDate);
            //获取数据列表
            List<Publication> Publications = PublicationQueryResult.ResultList;
            return Publications;
        }
    }
}
